Programming Languages Section

Ruby

Card image
Post by Amina Delali, September 14th,2021

Some Facts

Ruby: is a dynamic interpreted language. It is a scripting language used for web development.  But is also object-oriented, and a general-purpose programming language. You can use it to develop android applications as well as desktop gui applications. It is flexible and expressive with an easy and clean syntax. Being used by a lot of companies such as Hulu, Twitter and Github.
Ruby  language is built in  such a way to offer a balance between functional and imperative programming. It is a combination of features found in Perl, Smalltalk, Eiffel, Ada, and Lisp programming languages.



How to install it

  • on Windows:

    Following the recommendations available  in this page , download the latest installer compatible for your system. For example, the latest installer right now for a 64 bit Windows System is Ruby+Devkit 3.0.2-1 (x64).

    After you finished your download, run the downloaded file and follow the steps shown on the screen until the installation is successful.

  • on ubuntu :

    Simply run the following commands on the terminal:

  • sudo apt update 
    sudo apt install ruby-full

    To check the installed version, just run the following command:

    ruby -v

In the video below, the details of the installation of the Ruby language on Ubuntu.

The Hello World Example

  1. Create a new Hello file and save it in the Home folder with the extension rb. So the file will be named: Hello.rb
  2. Inside the file write the following code: 

    puts ("Hello World!")
  3. To run your code, simply open the terminal and write the following command on the terminal:
  4. ruby Hello.rb

Something to say ?

If you want to add something about the Ruby language or about this post, please feel free to do it by commenting below 🙂 .